package test.web.controller;

import org.springframework.web.bind.annotation.*;
import test.web.entity.ArriveOrderEntity;
import test.web.service.ArriveOrderService;

import java.util.List;

/**
 * @Author piaoransheng
 * @Date 2021/12/8 16:44
 */
@RestController
@RequestMapping("/arrive/order")
public class ArriveOrderController {

    private final ArriveOrderService arriveOrderService;

    public ArriveOrderController(ArriveOrderService arriveOrderService) {
        this.arriveOrderService = arriveOrderService;
    }


    @PostMapping("/add")
    public void add(@RequestBody ArriveOrderEntity arriveOrderEntity) {
        arriveOrderService.add(arriveOrderEntity);
    }

    @GetMapping("/findByStatus")
    public List<ArriveOrderEntity> findByStatus(@RequestParam("status") int status) {
        return arriveOrderService.findByStatus(status);
    }
}